﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Goldlight.Mvvm.Base;
using Goldlight.SampleApplication.ViewModels;
using Goldlight.SampleApplication.Model;

namespace Goldlight.SampleApplication.Views
{
    /// <summary>
    /// Interaction logic for AccountInformationView.xaml
    /// </summary>
    public partial class AccountInformationView : UserControl
    {
        private List<Country> _countries = null;

        public AccountInformationView()
        {
            InitializeComponent();

            BindData();
        }

        public object SelectedCountry { get; set; }

        private void BindData()
        {
            selectText.Content = Goldlight.SampleApplication.LanguageResources.Language.SelectText;
            GoldlightModelDataContext dc = new GoldlightModelDataContext();
            var dcCountries = from p in dc.Countries
                              orderby p.Name ascending
                              select p;
            _countries = dcCountries.ToList<Country>();
            countryCollection.Collection = _countries;
            cboCountry.SelectedIndex = 0;
        }
    }
}
